<!-- 采样及检测情况 -->
<template>
    <div class="container-box">   
        <el-table :data="list" style="width: 100%;align-items: center;justify-content: center;" border >
    <el-table-column  label="采样日期" min-width="15%" >
      <template #default="scope">
                  <div style="display: flex; align-items: center;justify-content:center;">
                    <span style="color:#797979; font-size:13px;text-align:center;">{{ parseTime(scope.row.samplingDate,'{y}-{m}-{d}')}}</span>
                  </div>
                </template>
      </el-table-column>
    <el-table-column prop="specimenType" label="标本类型" min-width="15%" />
    <el-table-column prop="samplingUnit" label="采样单位" min-width="15%"/>
    <el-table-column prop="testingUnit" label="检测单位" min-width="15%"/>
    <el-table-column prop="testMethod" label="检测方法" min-width="15%" />
    <el-table-column prop="detectionResult" label="检测结果" min-width="15%"/>
    <el-table-column prop="ct" label="CT值" min-width="15%"/>
  </el-table> 
      </div>
  </template>
  
  <script>
import { onMounted, reactive,toRefs } from 'vue'
import {useRoute} from 'vue-router'
import axios from '@/util/http'
import {parseTime} from '@/util/date'
  export default {
      name:'EditorialOnsetVisits',
      setup(){
        const patientId =useRoute().query.id
        const Table = reactive({
          list:[]
        })
        onMounted(()=>{
          axios({
            method:'get',
            url:'patient/addPatientSample',
            params:{
              id:patientId,
              currentPage:'1',
              pageSize:'10'
            }
          }).then((res)=>{
            console.log(res)
            Table.list = res.data.data
          })
        })
        const tableData = [
  {
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
]
return{
    tableData,...toRefs(Table),parseTime
}
      }
  }
  </script>
  
  <style scoped lang="less"> 
  /deep/th{
    background-color:#f9f9f9 !important;
    text-align: center !important;
  }
  /deep/.el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf {
    box-sizing: border-box;
    height: 45px;
    text-align: center;
  }
  .container-box{
    box-sizing: border-box;
    width: 100%;
    padding: 50px 20px;
    background-color: white;
  }
  .left{
    float: left;
    width: 50%;
    font-size: 13px;
    color: #333;
  }
  .right{
    float: left;
    width: 50%;
    font-size: 13px;
    color: #333;
  }
  label{
    box-sizing: border-box;
    height:45px;
    display:inline-block;
    padding: 15px 10px;
  }

  .right label{
    font-weight: 650;
  }
  </style>